<?php

	/**
	 * Improve thewire plugin
	 * 
	 * @author KimKha
	 * @package SNORG
	 */
	/**
	 * New wire post view for the activity stream
	 */
	 
	$owner = $vars['entity']->guid;
	$url_to_wire = $vars['url'] . "pg/thewire/" . $vars['entity']->username;
	
	//grab the users latest from the wire
	$latest_wire = get_entities("object", "thewire", $owner, "", 1, 0, false, 0);

	echo "<div class=\"profile_status\">";
	
	if($latest_wire){
		foreach($latest_wire as $lw){
			$content = $lw->description;
			$time = "<span> (" . friendly_time($lw->time_created) . ")</span>";
		}
		
		echo $content;
		if($owner == $_SESSION['user']->guid && get_context() != "profile")
			echo " <a class=\"status_update\" href=\"{$url_to_wire}\">update</a>";
		echo $time;
	}
	echo "</div>";
	
?>